import RobotError from "../errors/robot-error.js";
import Player from "../player/player.js";
import Item from "./item.js";
import Prop from "./prop.js";




/**还魂丹 复活用 */
export default class ReviveMedicine extends Prop {
	intro: string = "仅死亡后才可使用，使用后可立即恢复总生命值10%的血量";

	constructor() {
		super("还魂丹");
	}

	use(user: Player): { msg: string; } {
		if (user.isAlive()) throw new RobotError("醒醒你还没死");
		user.hpRatio = 0.1;
		return {
			msg: `成功使用还魂丹，现在你有${user.currentHp}点血量`
		};
	}
}

